<!--<?php
print <<<EOT
-->

<script src="../css/edit.js"></script>
<script>
<!--

function isTrueTime(s) {

    var patrn=/^[\d]{4}-[\d]{2}-[\d]{2}\s[\d]{2}:[\d]{2}$/; 
	
	if (!patrn.exec(s)) {
    	return false;
	}
	
    return true;
} 

function validate(form) {

	if(form.subject.value.length < 2 || form.subject.value.length > 60) {
		showMsg('msg_area', 'Subject must be no more than 60 characters.');
		form.subject.focus();
		return false;
	}
    
	if(form.address.value.length > 100) {
		showMsg('msg_area', 'Address must be no more than 100 characters.');
		form.address.focus();
		return false;
	}
	
	if(!isTrueTime(form.online.value)) {
		showMsg('msg_area', 'Invalid online.');
		form.online.focus();
		return false;
	}
	
	if(!isTrueTime(form.offline.value)) {
		showMsg('msg_area', 'Invalid offline.');
		form.offline.focus();
		return false;
	}
	
	return true;
}

//-->
</script>

<!--Content Start-->
<table width="95%" border="0" align="center">
  <tr> 
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td>
      <table width="60%" border="0" align="left" cellpadding="3" cellspacing="3">
        <tr> 
          <td>
          
            <span id="msg_area" class="js_msg">$alert_message</span>
            
            <table border="0" cellspacing="1" cellpadding="1">
              <tr>
                <td width="50%">
                  <form name="form1" method="post" action="i_news_add.php">
                  <table border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td><!--input type="text" class="text" name="name" size="20" value="Enter Subject ..." onFocus="form1.name.value=''"--></td>
                      <td><input name="image" type="image" onclick="form1.submit" src="../images/admin/bt_add.gif"></td>
			          <td><img src="../images/admin/shim.gif" width=30></td>
                    </tr>
                  </table>
                  </form>
                </td>
                <td align="right">
                <form name="form2" method="post"  onsubmit="return validate_search(this, '$key')">
                  <table border="0" cellspacing="1" cellpadding="1">
                    <tr>
                      <td><input type="text" class="text" name="key" size="20" value="$key" onFocus="form2.key.value='';return false"><input type="hidden" name="action" value="search"></td>
			          <td><input name="image" type="image" src="../images/admin/bt_search.gif" onclick="form2.submit;"></td>
			          <td><input name="image" type="image" src="../images/admin/bt_listall.gif" onClick="location.href='i_news.php';return false"></td>
                    </tr>
                  </table>
                  </form>
			    </td>
              </tr>
            </table>
            
            
            <span id="edit_area"></span>
            
            $page_show

            <table width="100%" border="0" cellspacing="1" cellpadding="1" class="tb">
              <tr class="tbheader"> 
		        <td width="15%">Subject</td>
			    <td width="15%">Address</td>
				<td width="15%">Address Chinese</td>
			    <td width="25%">Online</td>
			    <td width="25%">Offline</td>
			    <td width="5%">Publish</td>
			    <td width="15%"></td>
              </tr>

<!--
EOT;
for($i=0; $i<count($out_ary); $i++){
    $out_publish = $out_ary[$i]['publish_flag'] == 1 ? "Yes" : "No";
    $out_online = date("Y-m-d H:i", $out_ary[$i]['online']);
    $out_offline = date("Y-m-d H:i", $out_ary[$i]['offline']);
print <<<EOT
-->
              
              <tr class="tbcontent1"> 
		        <td>{$out_ary[$i]['subject']}</td>
                <td>{$out_ary[$i]['address']}</td>
				<td>{$out_ary[$i]['addresszh']}</td>
                <td>$out_online</td>
                <td>$out_offline</td>                
                <td>$out_publish</td>                
			    <td align=center bgcolor="ECECEC">
			    <a href="javascript:getAdminEdit('edit_area', '5', '{$out_ary[$i]['id']}')"><img src="../images/admin/bt_edit.gif" border="0" alt="Edit"></a>
			    <a href="i_news.php?action=del&nid={$out_ary[$i]['id']}" onclick="return confirm('Delete {$out_ary[$i]['subject']}?')"><img src="../images/admin/bt_delete.gif" border="0" Alt="Delete"></a>
			    </td>
              </tr>

<!--
EOT;
} print <<<EOT
--> 

                            
            </table>

            $page_show

          </td>
        </tr>
      </table>
      
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p></td>
  </tr>
</table>
<!--Content End-->

<!--
EOT;
?>-->